import React from 'react'
import {
  FileWordTwoTone,
  FileExcelTwoTone,
  FilePptTwoTone,
  PictureTwoTone,
  FilePdfTwoTone,
  FileTwoTone,
} from '@ant-design/icons'

const defaultConfig = {
  twoToneColor: '#F6742D',
  style: { fontSize: 23 },
}

function FileIcon(props) {
  const { sourceType, config } = props

  if (sourceType === 'word') {
    return <FileWordTwoTone {...defaultConfig} {...config} />
  } else if (sourceType === 'excel') {
    return <FileExcelTwoTone {...defaultConfig} {...config} />
  } else if (sourceType === 'ppt') {
    return <FilePptTwoTone {...defaultConfig} {...config} />
  } else if (sourceType === 'jpg') {
    return <PictureTwoTone {...defaultConfig} {...config} />
  } else if (sourceType === 'pdf') {
    return <FilePdfTwoTone {...defaultConfig} {...config} />
  } else {
    return <FileTwoTone {...defaultConfig} {...config} />
  }
}
export default FileIcon
